home *** CD-ROM | disk | FTP | other *** search
- /* ------------------------------------------------------------------------------
-
- FILENAME
- PrintingDrivers.h
-
- DESCRIPTION
- This file defines data types and API functions for
- printer driver development.
-
- COPYRIGHT
- Copyright © Apple Computer, Inc. 1989, 1990, 1991, 1992, 1993
- All rights reserved.
-
- ------------------------------------------------------------------------------- */
-
- #ifndef __PRINTINGDRIVERS__
- #define __PRINTINGDRIVERS__
-
-
- #ifndef __PRINTINGMESSAGES__
- #include <PrintingMessages.h>
- #endif
-
- #ifndef __PRINTING__
- #include <Printing.h>
- #endif
-
-
- /* ------------------------------------------------------------------------------
-
- Printing Driver Constants and Types
-
- -------------------------------------------------------------------------------- */
-
-
- enum {
- gxInputTraysMenuItem = -1 // Menu item number for "Input Trays..."
- };
-
- enum { // bit fields in communicationsOptions field of IOPrefsRec
- gxUseCustomIO = 0x00000001 // driver uses a non-standard IO mechanism
- };
-
- struct gxIOPrefsRec{ // buffering and IO preferences
- unsigned long communicationsOptions;
- unsigned long numBuffers;
- unsigned long bufferSize;
- unsigned long numReqBlocks;
- unsigned long openCloseTimeout;
- unsigned long readWriteTimeout;
- };
-
- typedef struct gxIOPrefsRec gxIOPrefsRec, *gxIOPrefsPtr, **gxIOPrefsHdl;
-
-
- struct gxPrintDestinationRec{ // information about writing to a file
- Boolean printToFile; // true if output is to go to a file
- FSSpec fSpec; // if going to a file, the FSSpec for the file
- char includeFonts; // true if fonts are to be included
- Str31 fileFormat; // format to write file
- };
-
- typedef struct gxPrintDestinationRec gxPrintDestinationRec, *gxPrintDestinationPtr, **gxPrintDestinationHdl;
-
-
- // this structure is the content of each cell in the standard PACK LDEF
-
- struct gxPortListRec{
- char firstMarker, secondMarker; // markers to indicate icon or non-icon version
- // if these are ≈ and ≈, then the cell is an icon cell.
- // Otherwise, it is assumed to be a standard text LDEF
- // cell
-
- Handle iconSuiteHandle; // the icon suite to draw for this cell
- Handle outputDriverName; // handle to the output driver name (for serial)
- Handle inputDriverName; // handle to the input driver name (for serial)
- Str255 iconName; // name to draw under the icon
- };
-
- typedef struct gxPortListRec gxPortListRec, *gxPortListPtr;
-
-
- /* ------------------------------------------------------------------------------
-
- Printing Driver Constants for resources in the desktop printer
-
- -------------------------------------------------------------------------------- */
- #define gxDeviceCommunicationsID (0)
-
-
- // ----------------------------------• 'prod' •----------------------------------
-
- // for PostScript devices, the device and version names of the device.
- // (0) product name is of type PString
- // (1) version is of type PString
- // (2) revision is of type PString
- // (3) vm available is of type long
- // (4) font stream type is of type scalerStreamTypeFlag
- // (5) language level is of type long
-
- #define gxPostscriptProductInfoType 'prod'
- #define gxPostscriptProductNameID (0)
- #define gxPostscriptVersionID (1)
- #define gxPostscriptRevisionID (2)
- #define gxPostscriptVMAvailableID (3)
- #define gxPostscriptFontStreamTypeID (4)
- #define gxPostscriptLanguageLevelID (5)
-
- /* ------------------------------------------------------------------------------
-
- Printing Driver Constants for status alerts
-
- -------------------------------------------------------------------------------- */
-
- // the ditl id for the auto feed button in the manual feed alert
-
- enum {
- gxAutoFeedButtonId = 3
- };
-
-
- // status resource id for the alerts
-
- enum {
- gxUnivAlertStatusResourceId = -28508
- };
-
-
- // status resource indices for the alerts
-
- enum {
- gxUnivManualFeedIndex = 2,
- gxUnivFailToPrintIndex = 3,
- gxUnivPaperJamIndex = 4,
- gxUnivOutOfPaperIndex = 5,
- gxUnivNoPaperTrayIndex = 6,
- gxUnivPrinterReadyIndex = 7,
- gxUnivAlertBeforeIndex = 9,
- gxUnivAlertAfterIndex = 10
- };
-
- // allocation sizes for status buffers needed for automatic alerts
-
-
- enum {
- gxDefaultStatusBufferSize = 10,
- gxManualFeedStatusBufferSize = 34,
- gxOutOfPaperStatusBufferSize = 42
- };
-
-
- // structures for status buffers
-
- struct gxManualFeedRecord{ // structure passed in statusBuffer of StatusRecord for manual feed alert
- Boolean canAutoFeed; // true if driver can switch to auto feed
- Str31 paperTypeName; // name of paperType to feed manually
- };
-
- typedef struct gxManualFeedRecord gxManualFeedRecord;
-
-
- struct gxOutOfPaperRecord{ // structure passed in statusBuffer of StatusRecord for out of paper alert
- Str31 paperTypeName; // name of printing document
- };
-
- typedef struct gxOutOfPaperRecord gxOutOfPaperRecord;
-
-
- /* ------------------------------------------------------------------------------
-
- Old Application Support
-
- -------------------------------------------------------------------------------- */
-
-
- // the format of a 'cust' resource
-
- struct gxCustomizationRec{
- short horizontalResolution;
- short verticalResolution;
- short upDriverType;
- Point patternStretch;
- short translatorSettings;
- };
-
- typedef struct gxCustomizationRec gxCustomizationRec, *gxCustomizationPtr, **gxCustomizationHdl;
-
-
- // the format of a 'resl' resource
-
- struct gxResolutionRec{
- short rangeType; // always 1
- short xMinimumResolution;
- short xMaximumResolution;
- short yMinimumResolution;
- short yMaximumResolution;
- short resolutionCount;
- Point resolutions[1];
- };
-
- typedef struct gxResolutionRec gxResolutionRec, *gxResolutionPtr, **gxResolutionHdl;
-
-
- // constants for the "universal" print record...
-
-
- enum { // version number for "universal" print record
- gxPrintRecordVersion = 8
- };
-
- enum { // for feed field...
- gxAutoFeed = 0,
- gxManualFeed = 1
- };
-
- enum { // bit fields for options field...
- gxPreciseBitmap = 0x0001, // tall adjusted (IW), precise bitmap (LW, SC)
- gxBiggerPages = 0x0002, // no gaps (IW), larger print area (LW)
- gxGraphicSmoothing = 0x0004, // graphic smoothing (LW)
- gxTextSmoothing = 0x0008, // text smoothing (SC)
- gxFontSubstitution = 0x0010, // font substitution
- gxInvertPage = 0x0020, // b/w invert image
- gxFlipPageHoriz = 0x0040, // flip horizontal
- gxFlipPageVert = 0x0080, // flip vertical
- gxColorMode = 0x0100, // color printing
- gxBidirectional = 0x0200, // bidirectional printing
- gxUserFlag0 = 0x0400, // user flag 0
- gxUserFlag1 = 0x0800, // user flag 1
- gxUserFlag2 = 0x1000, // user flag 2
- gxReservedFlag0 = 0x2000, // reserved flag 0
- gxReservedFlag1 = 0x4000, // reserved flag 1
- gxReservedFlag2 = 0x8000 // reserved flag 2
- };
-
- enum { // for orientation field...
- gxPortraitOrientation = 0,
- gxLandscapeOrientation = 1,
- gxAltPortraitOrientation = 2,
- gxAltLandscapeOrientation = 3
- };
-
- enum { // for qualityMode field...
- gxBestQuality = 0,
- gxFasterQuality = 1,
- gxDraftQuality = 2
- };
-
- enum { // for firstTray and remainingTray fields...
- gxFirstTray = 0,
- gxSecondTray = 1,
- gxThirdTray = 2
- };
-
- enum { // for coverPage field...
- gxNoCoverPage = 0,
- gxFirstPageCover = 1,
- gxLastPageCover = 2
- };
-
- enum { // for headMotion field...
- gxUnidirectionalMotion = 0,
- gxBidirectionalMotion = 1
- };
-
- enum { // for saveFile field...
- gxNoFile = 0,
- gxPostScriptFile = 1
- };
-
-
- // the format of the "universal" print record
-
- struct gxUniversalPrintRecord{
- short prVersion; // print record version
-
- // prInfo subrecord...
-
- short appDev; // device kind, always 0
- short appVRes; // application vertical resolution
- short appHRes; // application horizontal resolution
- Rect appPage; // page size, in application resolution
-
- Rect appPaper; // paper rectangle [offset from rPage]
-
- // prStl subrecord...
-
- short devType; // device type, always 0xA900 (was wDev)
- short pageV; // page height in 120ths of an inch
- short pageH; // page width in 120ths of an inch
- char fillByte; // page calculation mode
- char feed; // feed mode
-
- // prInfoPT subrecord...
-
- short devKind; // device kind, always 0
- short devVRes; // device vertical resolution
- short devHRes; // device horizontal resolution
- Rect devPage; // device page size
-
- // prXInfo subrecord...
-
- short actualCopies; // actual number of copies for this job
- short options; // options for this device
- short reduction; // reduce/enlarge factor
-
- char orientation; // orientation of paper ( 0=portrait, 1=landscape )
-
- // clusters...
-
- char qualityMode; // quality mode
- char coverPage; // cover page
- char firstTray; // first feed tray
- char remainingTray; // remaining feed tray
- char headMotion; // head motion
- char saveFile; // save file
-
- char userCluster1; // three clusters left over...
- char userCluster2;
- char userCluster3;
-
- // prJob subrecord...
-
- short firstPage; // first page
- short lastPage; // last page
- short copies; // # of copies, always 1
- char reserved1; // always true, unused
- char reserved2; // always true, unused
- PrIdleProcPtr pIdleProc; // idle proc
- Ptr pFileName; // spool file name pointer
- short fileVol; // spool file vRefNum
- char fileVers; // file version, must be 0
- char reserved3; // always 0
-
- short printX[19]; // internal use
- };
-
- typedef struct gxUniversalPrintRecord gxUniversalPrintRecord, *gxUniversalPrintRecordPtr, **gxUniversalPrintRecordHdl;
-
-
-
- /* ------------------------------------------------------------------------------
-
- Compatibility Printing Messages
-
- -------------------------------------------------------------------------------- */
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- OSErr Forward_GXPrOpenDoc (THPrint, TPPrPort *)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrCloseDoc (TPPrPort)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrOpenPage (TPPrPort, TPRect, Point resolution)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrClosePage (TPPrPort)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrintDefault (THPrint)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrStlDialog (THPrint, Boolean *)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrJobDialog (THPrint, Boolean *)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrStlInit (THPrint, TPPrDlg *)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrJobInit (THPrint, TPPrDlg *)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrDlgMain (THPrint, PDlgInitProcPtr, Boolean *)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrValidate (THPrint, Boolean *)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrJobMerge (THPrint, THPrint)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrGeneral (Ptr)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXConvertPrintRecordTo (THPrint)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXConvertPrintRecordFrom (THPrint)
- = GXFORWARDGLUE;
-
- OSErr Forward_GXPrintRecordToJob (THPrint, gxJob)
- = GXFORWARDGLUE;
-
-
- #ifdef __cplusplus
- }
- #endif
-
-
-
- /* ------------------------------------------------------------------------------
-
- Raster Driver Contants and Types
-
- -------------------------------------------------------------------------------- */
-
-
-
- typedef long gxRasterPlaneOptions;
-
- enum { // bit fields in RasterPlaneOptions
- gxDefaultOffscreen = 0x00000000, // default value - bits are allocated for the client, halftoning takes place
- gxDontSetHalftone = 0x00000001, // don't call SetViewPortHalftone
- gxDotTypeIsDitherLevel = 0x00000002 // call SetViewPortDither using the dotType as the level
- };
-
- struct gxPlaneSetupRec{ // input structure for setting up the offscreen
- gxRasterPlaneOptions planeOptions; // options for the offscreen package
- gxHalftone planeHalftone; // OPTIONAL: halftone structure for this plane
- gxColorSpace planeSpace; // OPTIONAL: noSpace will get the graphics default
- gxColorSet planeSet; // OPTIONAL: NIL gets the default
- gxColorProfile planeProfile; // OPTIONAL: NIL gets no matching
- };
-
- typedef struct gxPlaneSetupRec gxPlaneSetupRec;
-
- struct gxOffscreenSetupRec{
- short width; // Width in pixels
- short minHeight; // minimum height in pixels - actual height returned here
- short maxHeight; // maximum height in pixels
- Fixed ramPercentage; // maximum percentage of RAM to take
- long ramSlop; // amount of RAM to be sure to leave
- short depth; // Depths in bits of each plane
- gxMapping vpMapping; // mapping to assign to offscreen viewPorts
- gxMapping vdMapping; // mapping to assign to offscreen viewDevices
- short planes; // # of planes to allocate of depth bits each (can be more than 4)
- gxPlaneSetupRec planeSetup[4]; // parameters for each plane, 4 is provided because it is most handy for writers of devices
- };
-
- typedef struct gxOffscreenSetupRec gxOffscreenSetupRec;
-
-
-
- struct gxOffscreenPlaneRec{ // the format of one plane in the offscreen planar area
- gxViewPort theViewPort; // viewPort for the offscreen
- gxViewDevice theDevice; // viewDevice for the offscreen
- gxViewGroup theViewGroup; // the viewGroup that they share
- gxShape theBitmap; // the offscreen bitmap shape
- gxBitmap theBits; // the bits of the offscreen
- };
-
- typedef struct gxOffscreenPlaneRec gxOffscreenPlaneRec;
-
- struct gxOffscreenRec{ // an entire offscreen area
- short numberOfPlanes; // number of planes we have
- Handle offscreenStorage; // handle containing the bitmaps image data
- gxOffscreenPlaneRec thePlanes[1]; // planes to draw in
- };
-
- typedef struct gxOffscreenRec gxOffscreenRec, *gxOffscreenPtr, **gxOffscreenHdl;
-
-
-
- typedef long gxRasterRenderOptions;
-
- enum { // bit fields in RasterRenderOptions
- gxDefaultRaster = 0x00000000, // default raster options
- gxDontResolveTransferModes = 0x00000001, // 0=Resolve, 1=Don't Resolve
- gxRenderInReverse = 0x00000002, // traverse image in reverse order
- gxOnePlaneAtATime = 0x00000004, // render each plane separately
- gxSendAllBands = 0x00000008 // send even empty bands
- };
-
-
- struct gxRasterPrefsRec{ // structure of resource to control raster imaging
- gxRasterRenderOptions renderOptions; // options for the raster imaging system
- Fixed hImageRes; // horizontal resolution to image at
- Fixed vImageRes; // vertical resolution to image at
- short minBandSize; // minimum band size to use (in pixels)
- short maxBandSize; // maximum band size to use (in pixels), 0 == entire page
- Fixed ramPercentage; // maximum percentage of RAM to take
- long ramSlop; // amount of RAM to be sure to leave
- short depth; // depth in pixels (PER PLANE!)
- short numPlanes; // number of planes to render
- gxPlaneSetupRec planeSetup[1]; // one for each plane
- };
-
- typedef struct gxRasterPrefsRec gxRasterPrefsRec, *gxRasterPrefsPtr, **gxRasterPrefsHdl;
-
-
- typedef long gxRasterPackageOptions;
-
- enum { // bit fields in RasterPackageOptions
- gxSendAllColors = 0x00000001, // send even clean bands through
- gxInterlaceColor = 0x00000002, // ribbon contamination is a concern
- gxOverlayColor = 0x00000004, // color printer without a ribbon problem
- gxUseColor = (gxInterlaceColor|gxOverlayColor) // this is a color printer
- };
-
-
- struct gxRasterPackageRec{ // resource to control the RasterDataIn message
- Ptr bufferSize; // buffer size for packaging (>= maximum head pass size)
- short colorPasses; // 1 (b/w) or 4 (CMYK) is typical
- short headHeight; // printhead height in pixels
- short numberPasses; // number of head passes it takes to == iHeadHeight
- short passOffset; // offset between passes, in pixels
- gxRasterPackageOptions packageOptions; // packaging options
- };
-
- typedef struct gxRasterPackageRec gxRasterPackageRec, *gxRasterPackagePtr, **gxRasterPackageHdl;
-
-
- struct gxRasterPackageBitmapRec{ // for RasterPackageBitmap message
- gxBitmap *bitmapToPackage; // bitmap containing the data to package
- unsigned short startRaster; // raster to begin the packaging from
- unsigned short colorBand; // for which color pass this is a packaging request
- Boolean isBandDirty; // whether there are any dirty bits in this band
- Rect dirtyRect; // which bits are dirty
- };
-
- typedef struct gxRasterPackageBitmapRec gxRasterPackageBitmapRec;
-
-
- struct gxStandardNumberRec{ // for outputing numbers
- short numberType; // type of numberic output desired
- short minWidth; // minimum output width of the number
- char padChar; // pad character for numbers shorter than the minWidth
- char alignment; // whee!
- Str31 startString; // prefix string
- Str31 endString; // postfix string
- };
-
- typedef struct gxStandardNumberRec gxStandardNumberRec, *gxStandardNumberPtr;
-
-
-
- struct gxRasterPackageControlsRec{ // structure of resource to control other messages
- short startPageStringID; // 'wstr' to send to the device at start of page
- short formFeedStringID; // 'wstr' to send to the device to cause a form feed
- short forwardMax; // line feed strings
- gxStandardNumberRec forwardLineFeed;
- short reverseMax;
- gxStandardNumberRec reverseLineFeed;
- };
-
- typedef struct gxRasterPackageControlsRec gxRasterPackageControlsRec, *gxRasterPackageControlsPtr, **gxRasterPackageControlsHdl;
-
-
-
- struct gxRasterImageDataRec{ // raster imaging system imageData structure
-
- // setup values
-
- gxRasterRenderOptions renderOptions; // options for the raster imaging system
- Fixed hImageRes; // horizontal resolution to image at
- Fixed vImageRes; // vertical resolution to image at
- short minBandSize; // smallest band that makes sense for this device
- short maxBandSize; // biggest band that makes sense, or 0 for "full page"
- gxRectangle pageSize; // size of page for device
-
- // values used within the RasterDataIn message
-
- short currentYPos; // current position moving down the page
- gxRasterPackageRec packagingInfo; // raster packaging record
-
- // values used within the remaining messages
-
- Boolean optionsValid; // were options specified by the driver?
- gxRasterPackageControlsRec packageControls; // options for the packaging messages
-
- gxOffscreenSetupRec theSetup; // setup for the offscreen code, variable length componant
- };
-
- typedef struct gxRasterImageDataRec gxRasterImageDataRec, *gxRasterImageDataPtr, **gxRasterImageDataHdl;
-
-
-
- /* ------------------------------------------------------------------------------
-
- Raster Driver Imaging Messages
-
- -------------------------------------------------------------------------------- */
-
-
- #ifndef __powerc
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- #define GXRASTERMSGGLUE(selector) SendMessageGlue(0x0001, selector)
- #define GXFORWARDGLUE ForwardThisMessageGlue
-
- OSErr Send_GXRasterDataIn (gxOffscreenHdl, gxRectangle *bandRectangle, gxRectangle *dirtyRectangle)
- = GXRASTERMSGGLUE(gxRasterDataIn);
- OSErr Forward_GXRasterDataIn (gxOffscreenHdl, gxRectangle *bandRectangle, gxRectangle *dirtyRectangle)
- = GXFORWARDGLUE;
-
- OSErr Send_GXRasterLineFeed (short *lineFeedSize, Ptr buffer, unsigned long *bufferPos, gxRasterImageDataHdl)
- = GXRASTERMSGGLUE(gxRasterLineFeed);
- OSErr Forward_GXRasterLineFeed (short *lineFeedSize, Ptr buffer, unsigned long *bufferPos, gxRasterImageDataHdl)
- = GXFORWARDGLUE;
-
- OSErr Send_GXRasterPackageBitmap (gxRasterPackageBitmapRec *whatToPackage, Ptr buffer,
- unsigned long *bufferPos, gxRasterImageDataHdl)
- = GXRASTERMSGGLUE(gxRasterPackageBitmap);
- OSErr Forward_GXRasterPackageBitmap (gxRasterPackageBitmapRec *whatToPackage, Ptr buffer,
- unsigned long *bufferPos, gxRasterImageDataHdl)
- = GXFORWARDGLUE;
-
- #ifdef __cplusplus
- }
- #endif
- #endif
-
-
-
- /* ------------------------------------------------------------------------------
-
- Vector Driver Contants and Types
-
- -------------------------------------------------------------------------------- */
-
-
-
- typedef long gxVectorRenderOptions;
-
- enum { // bit fields in VectorRenderOptions
- gxColorSort = 0x00000001, // set for pen plotters.
- gxATransferMode = 0x00000002, // set if transfer modes need to be resolved
- gxNoOverlap = 0x00000004, // set if non-overlapping output is desired
- gxAColorBitmap = 0x00000008, // set if color bitmap output is desired
- gxSortbyPenPos = 0x00000010, // set if shapes are to be drawn in the order of the pen index
- // in the pen table. NOTE: this is not the pen position in the carousel.
- gxPenLessPlotter = 0x00000020, // indicates raster printer/plotter
- gxCutterPlotter = 0x00000040, // indicates cutter
- gxNoBackGround = 0x00000080 // set if shapes that map to the background color should not be sent to driver
- };
-
-
- typedef long gxVectorShapeOptions;
-
- enum { // bit fields in gxVectorShapeOptions
- gxUnidirectionalFill = 0x00000001, // generate scanlines in one direction only.. useful for transparencies
- gxAlsoOutlineFilledShape = 0x00000002 // turn on this bit to also outline solid filled shapes
- };
-
-
- struct gxVHalftoneCompRec{
- Fixed angle; // angle to halftone at. Must be 0, 90, 45 or 135
- long penIndex; // index of the pen to draw this component with
- };
-
- typedef struct gxVHalftoneCompRec gxVHalftoneCompRec;
-
-
- struct gxVHalftoneRec{
- gxColorSpace halftoneSpace;
- gxVHalftoneCompRec halftoneComps[4]; // info for each color component
- long penIndexForBW; // pen index to draw one bit deep or black and white bitmap with
- };
-
- typedef struct gxVHalftoneRec gxVHalftoneRec;
-
-
- struct gxVectorShapeDataRec{
- gxVectorShapeOptions shapeOptions; // options to control shape handling
- long maxPolyPoints; // maximum number of polygon points that device can support
- Fixed shapeError; // defines allowed deviation from the original shape
- Fixed textSize; // text above this size is filled; text below this size is outlined
- Fixed frameSize; // frame's smaller than this -> shape stroked; frame's larger -> shape is filled
- };
-
- typedef struct gxVectorShapeDataRec gxVectorShapeDataRec;
-
-
- struct gxVectorImageDataRec{ // vector imaging system imageData structure
- gxVectorRenderOptions renderOptions; // options to control rendering: color sort, clipping, etc.
- Fixed devRes; // device resolution
- gxTransform devTransform; // mapping, clip and halftoning information for colored bitmaps
- gxColorSet clrSet; // entire set of colors; usually indexed color space for pen plotters
- gxColor bgColor; // the background color in the color space specified by the clrSpace field
- gxVHalftoneRec halftoneInfo; // defines halftone information for color bitmaps
- gxPenTableHdl hPenTable; // complete list of pens along with their pen positions and thickness
- gxRectangle pageRect; // page dimensions
- gxVectorShapeDataRec shapeData; // information on how to render a shape
- };
-
- typedef struct gxVectorImageDataRec gxVectorImageDataRec, *gxVectorImageDataPtr, **gxVectorImageDataHdl;
-
-
-
- /* ------------------------------------------------------------------------------
-
- Vector Driver Imaging Messages
-
- -------------------------------------------------------------------------------- */
-
-
- #ifndef __powerc
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- #define GXVECTORMSGGLUE(selector) SendMessageGlue(0x0001, selector)
- #define GXFORWARDGLUE ForwardThisMessageGlue
-
-
- OSErr Send_GXVectorPackageShape (gxShape, long penIndex)
- = GXVECTORMSGGLUE(gxVectorPackageData);
- OSErr Forward_GXVectorPackageShape (gxShape, long penIndex)
- = GXFORWARDGLUE;
-
- OSErr Send_GXVectorLoadPens (gxPenTableHdl, long *shapeCounts, boolean *penTableChanged)
- = GXVECTORMSGGLUE(gxVectorLoadPens);
- OSErr Forward_GXVectorLoadPens (gxPenTableHdl, long *shapeCounts, boolean *penTableChanged)
- = GXFORWARDGLUE;
-
- OSErr Send_GXVectorVectorizeShape (gxShape, long penIndex, gxVectorShapeDataRec *)
- = GXVECTORMSGGLUE(gxVectorVectorizeShape);
- OSErr Forward_GXVectorVectorizeShape (gxShape, long penIndex, gxVectorShapeDataRec *)
- = GXFORWARDGLUE;
-
-
- #ifdef __cplusplus
- }
- #endif
- #endif
-
-
-
- /* ------------------------------------------------------------------------------
-
- PostScript Driver Contants and Types
-
- -------------------------------------------------------------------------------- */
-
-
-
- enum { gxPostSynonym = (long)'post' };
-
-
- typedef long gxPostScriptRenderOptions;
-
- enum { // bit fields in PostScriptRenderOptions
- gxNeedsHexOption = 0x00000001, // convert all binary data to hex
- gxNeedsCommentsOption = 0x00000002, // issue PostScript comments
- gxBoundingBoxesOption = 0x00000004, // calculate the values for %%BoundingBox: and %%PageBoundingBox: -- requires needsCommentsOption
- gxPortablePostScriptOption = 0x00000008, // generate portable PostScript
- gxTextClipsToPathOption = 0x00000010, // convert all clips that are composed of text to path shapes
- gxFlattenClipPathOption = 0x00000020, // convert all clips that are path shapes to polygons (helps better control point limit)
- gxUseCharpath1Option = 0x00000040, // (ignored if text clips are converted to paths) When the clip is text,
- // do it one glyph at a time, redrawing the main shape each time
- gxUseLevel2ColorOption = 0x00000080 // When printing to level-2 use level-2 device independent color
- };
-
-
-
- struct gxPrinterGlyphsRec{
-
- gxFont theFont; // ---> font reference.
- long nGlyphs; // ---> Number of glyphs in the font.
-
- gxFontPlatform platform; // <--- How printer font is encoded.
- gxFontScript script; // <--- Script if platform != glyphPlatform
- gxFontLanguage language; // <--- Language if platform != glyphPlatform.
-
- long vmUsage; // <--- how much PostScript VM font uses.
-
- /** size of this is longAlligned(nGlyphs) **/
- unsigned long glyphBits[1]; // <--- Bit array of which system glyphs are in printer.
-
- };
-
- typedef struct gxPrinterGlyphsRec gxPrinterGlyphsRec;
-
- struct gxPostScriptImageDataRec{ // PostScript imaging system imageData structure
- short languageLevel; // PostScript language level
- gxColorSpace devCSpace; // the printer's color space
- gxColorProfile devCProfile; // The printer's color profile for matching
- gxPostScriptRenderOptions renderOptions; // options for the imaging system
- long pathLimit; // maximum path size
- short gsaveLimit; // maximum number of gsaves allowed
- short opStackLimit; // operand stack limit
- scalerStreamTypeFlag fontType; // these are the font types that the printer supports
- long printerVM; // how much memory is in the printer
- long reserved0;
- };
-
- typedef struct gxPostScriptImageDataRec gxPostScriptImageDataRec, *gxPostScriptImageDataPtr, **gxPostScriptImageDataHdl;
-
-
- struct gxProcSetListRec{ // for GetProcSetList / DownLoadProcSetList messages
- Signature clientid;
- OSType controlType; // the driver will call FetchTaggedData on each of these resources
- short controlid;
- OSType dataType;
- long reserved0;
- };
-
- typedef struct gxProcSetListRec gxProcSetListRec, *gxProcSetListPtr, **gxProcSetListHdl;
-
-
-
-
- enum { // possible results of querying printer (returned by PostScriptQueryPrinter message)
- gxPrinterOK = 0,
- gxIntializePrinter = 1,
- gxFilePrinting = 2,
- gxResetPrinter = 128
- };
-
-
-
- /* ------------------------------------------------------------------------------
-
- PostScript Driver Imaging Messages
-
- -------------------------------------------------------------------------------- */
-
-
- #ifndef __powerc
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- #define GXPOSTSCRIPTMSGGLUE(selector) SendMessageGlue(0x0001, selector)
- #define GXFORWARDGLUE ForwardThisMessageGlue
-
-
- // device control messages
-
- OSErr Send_GXPostScriptQueryPrinter (long *)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptQueryPrinter);
- OSErr Forward_GXPostScriptQueryPrinter (long *)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptInitializePrinter (void)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptInitializePrinter);
- OSErr Forward_GXPostScriptInitializePrinter (void)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptResetPrinter (void)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptResetPrinter);
- OSErr Forward_GXPostScriptResetPrinter (void)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptExitServer (void)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptExitServer);
- OSErr Forward_GXPostScriptExitServer (void)
- = GXFORWARDGLUE;
-
-
- // device communication messages
-
-
- OSErr Send_GXPostScriptGetStatusText (Handle)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptGetStatusText);
- OSErr Forward_GXPostScriptGetStatusText (Handle)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptGetPrinterText (Handle)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptGetPrinterText);
- OSErr Forward_GXPostScriptGetPrinterText (Handle)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptScanStatusText (Handle)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptScanStatusText);
- OSErr Forward_GXPostScriptScanStatusText (Handle)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptScanPrinterText (Handle)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptScanPrinterText);
- OSErr Forward_GXPostScriptScanPrinterText (Handle)
- = GXFORWARDGLUE;
-
-
- // proc set management messages
-
-
- OSErr Send_GXPostScriptGetDocumentProcSetList (gxProcSetListHdl, gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptGetDocumentProcSetList);
- OSErr Forward_GXPostScriptGetDocumentProcSetList (gxProcSetListHdl, gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptDownloadProcSetList (gxProcSetListHdl, gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptDownloadProcSetList);
- OSErr Forward_GXPostScriptDownloadProcSetList (gxProcSetListHdl, gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
-
- // font management messages
-
-
- OSErr Send_GXPostScriptGetPrinterGlyphsInformation (gxPrinterGlyphsRec *)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptGetPrinterGlyphsInformation);
- OSErr Forward_GXPostScriptGetPrinterGlyphsInformation (gxPrinterGlyphsRec *)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptStreamFont (gxFont fontref, scalerStream* streamPtr)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptStreamFont);
- OSErr Forward_GXPostScriptPostScriptStreamFont (gxFont fontref, scalerStream* streamPtr)
- = GXFORWARDGLUE;
-
-
- // document structuring and formatting messages
-
-
- OSErr Send_GXPostScriptDoDocumentHeader (gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptDoDocumentHeader);
- OSErr Forward_GXPostScriptDoDocumentHeader (gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptDoDocumentSetup (gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptDoDocumentSetUp);
- OSErr Forward_GXPostScriptDoDocumentSetup (gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptDoDocumentTrailer (gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptDoDocumentTrailer);
- OSErr Forward_GXPostScriptDoDocumentTrailer (gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
-
- // page structuring and formatting messages
-
-
- OSErr Send_GXPostScriptDoPageSetup (gxFormat, long, gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptDoPageSetUp);
- OSErr Forward_GXPostScriptDoPageSetup (gxFormat, long, gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptSelectPaperType (gxPaperType, long, gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptSelectPaperType);
- OSErr Forward_GXPostScriptSelectPaperType (gxPaperType, long, gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
- OSErr Send_GXPostScriptDoPageTrailer (gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptDoPageTrailer);
- OSErr Forward_GXPostScriptDoPageTrailer (gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
-
- #ifdef applec
- OSErr Send_GXPostScriptEjectPage (gxPaperType, long pagenumber, long copiescount, short erasepage, gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptEjectPage);
- OSErr Forward_GXPostScriptEjectPage (gxPaperType, long pagenumber, long copiescount, short erasepage, gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
- #else
- OSErr Send_GXPostScriptEjectPage (gxPaperType, long pagenumber, long copiescount, long erasepage, gxPostScriptImageDataHdl)
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptEjectPage);
- OSErr Forward_GXPostScriptEjectPage (gxPaperType, long pagenumber, long copiescount, long erasepage, gxPostScriptImageDataHdl)
- = GXFORWARDGLUE;
- #endif
-
- // shape imaging messages
-
-
- OSErr Send_GXPostScriptProcessShape (gxShape page,long trcount, gxTransform trlist[])
- = GXPOSTSCRIPTMSGGLUE(gxPostscriptProcessShape);
- OSErr Forward_GXPostScriptProcessShape (gxShape page,long trcount, gxTransform trlist[])
- = GXFORWARDGLUE;
-
-
- #ifdef __cplusplus
- }
- #endif
- #endif
-
-
-
- /* ------------------------------------------------------------------------------
-
- Driver API Functions
-
- -------------------------------------------------------------------------------- */
-
- enum {
- gxMissingImagePointer = -4 // for printer gxViewDevice bitmaps
- };
-
-
- #define GXDRIVERAPIGLUE(selector) {0x203C, 0x0002, selector, 0xABFE}
-
-
- #ifndef __powerc
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- OSErr GXAddPrinterViewDevice (gxPrinter, gxViewDevice)
- = GXDRIVERAPIGLUE(0);
-
- OSErr GXGetAvailableJobFormatModes (gxJobFormatModeTableHdl *)
- = GXDRIVERAPIGLUE(1);
-
- OSErr GXSetPreferredJobFormatMode (gxJobFormatMode, Boolean directOnly)
- = GXDRIVERAPIGLUE(2);
-
-
- #ifdef applec
- OSErr GXPrintingAlert (short iconId,
- short txtSize,
- short defaultTitleNum,
- short cancelTitleNum,
- short textLength,
- Ptr pAlertMsg,
- StringPtr actionTitle,
- StringPtr title2,
- StringPtr title3,
- StringPtr msgFont,
- ModalFilterProcPtr filterProc,
- short *itemHit,
- StringPtr alertTitle)
- = GXDRIVERAPIGLUE(3);
-
- OSErr GXGetPrintingAlert (short alertResId, ModalFilterProcPtr, short *itemHit)
- = GXDRIVERAPIGLUE(4);
-
- OSErr GXFetchDTPData (Str31 dtpName, OSType theType, short theID, Handle *theData)
- = GXDRIVERAPIGLUE(5);
-
- OSErr GXWriteDTPData (Str31 dtpName, OSType theType, short theID, Handle theData)
- = GXDRIVERAPIGLUE(6);
-
- OSErr GXHandleChooserMessage (gxJob *aJob, Str31 driverName, short message, short caller,
- StringPtr objName, StringPtr zoneName, ListHandle theList, long p2)
- = GXDRIVERAPIGLUE(7);
-
- #else
-
- OSErr GXPrintingAlert (long iconId,
- long txtSize,
- long defaultTitleNum,
- long cancelTitleNum,
- long textLength,
- Ptr pAlertMsg,
- StringPtr actionTitle,
- StringPtr title2,
- StringPtr title3,
- StringPtr msgFont,
- ModalFilterProcPtr filterProc,
- short *itemHit,
- StringPtr alertTitle)
- = GXDRIVERAPIGLUE(3);
-
- OSErr GXGetPrintingAlert (long alertResId, ModalFilterProcPtr, short *itemHit)
- = GXDRIVERAPIGLUE(4);
-
- OSErr GXFetchDTPData (Str31 dtpName, OSType theType, long theID, Handle *theData)
- = GXDRIVERAPIGLUE(5);
-
- OSErr GXWriteDTPData (Str31 dtpName, OSType theType, long theID, Handle theData)
- = GXDRIVERAPIGLUE(6);
-
- OSErr GXHandleChooserMessage (gxJob *aJob, Str31 driverName, long message, long caller,
- StringPtr objName, StringPtr zoneName, ListHandle theList, long p2)
- = GXDRIVERAPIGLUE(7);
- #endif
-
-
-
-
- #ifdef __cplusplus
- }
- #endif
- #endif
-
-
- #endif